<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>登陆</title>
    <link rel="stylesheet" href="/css/supplies/bootstrap.min.css">
    <link rel="stylesheet" href="/css/supplies/common.css">
    <link rel="stylesheet" href="/css/supplies/SmsLogin.css">

    <style>
        .select_a{
            text-decoration: none;
            border:1px solid #BDBDBD;
            display: block;
            width: 160px;
            height: 44px;
            text-align: center;
            color: white;
            out-line: none;
        }
        .select_a:hover{
            text-decoration: none;
            color: white;
            background-color: #BDBDBD;
        }
        .select_a:visited{
            text-decoration: none;
            color: white;
        }
        .select_a:active{
            text-decoration: none;
            color: white;
        }
        a:focus{
            text-decoration: none;
            color:#000;
        }
        .placeholder{
            width: 260px;
        }
    </style>
</head>
<body>
<div class="reg_container">
    <div class="reg_content form-inline">
        <div class="reg_left_from form-group">
            <div class="form_title" style="font-size: 26px;line-height: 24px;color: #FF690D;">
                登陆</br><span class="font_size_16">Login</span>
            </div>
            <div class="form_content">
                <div class="user_name input_div">
                    <div class="placeholder font_size_14">手机号<br/><span class="font_size_11">Phone number</span></div>
                    <input type="text" class="tel input_placeholder" isvalid="yes" checkexpession="NotNull" errormsg="手机号不能为空<br/>Cell phone number can not be empty"/>
                </div>
                <div class="code form-inline input_div">
                    <div class="placeholder fotn_size_14" style="width: 160px;">验证码<br/><span class="font_size_11">Verificotion code</span></div>
                    <input type="text" class="form-group code input_placeholder" style="width: 160px;" isvalid="yes" checkexpession="NotNull" errormsg="验证码<br/>The verifying code cannot be empty"/>
                    <div class="form-group select_a get_code font_size_14"
                         style="width: 96px;background: -webkit-gradient(linear, 0 0, 0 100%, from(#fff), to(#fff));;border: 1px solid #FF6A10;color: #FF6A10;">获取验证码</br><span class="font_size_11">get the verify</span></div>
                </div>
            </div>
            <div class="commint_btn">
                <a class="select_a font_size_14 btn_color_right ">登陆</br><span class="font_size_11">Login</span></a>
            </div>
            <div class="login_remark form-inline" style="font-size: 12px;">
                <a href="__APP__/supplies/index/login" class="form-group" style="color: #333333;" >密码登陆<br/><span style="color: #666666;">password login</span></a>
                <a href="__APP__/supplies/index/register" class="form-group" style="float: right;color: #333333;">去注册<br/><span style="color: #666666;">register</span></a>
            </div>
        </div>
    </div>
</div>
</body>
<script rel="script" src="/js/supplies/jquery.min.js"></script>
<script rel="script" src="/js/supplies/valodator/validator.js"></script>
<script rel="script" src="/js/supplies/common_input.js"></script>
<script>
    //获取验证码
    $('.get_code').click(function(){
        $tel =  $('.tel').val();
        $.ajax({
            type: "get",
            url: "__APP__/apishop/index/getMsgCode",
            cache: false,
            data: {tel: $tel},
            dataType: "json",
            success: function (data) {
                console.log(data);
            }
        });
    })
    //提交
    $('.commint_btn').click(function(){
        $tel =  $('.tel').val();
        $code =  $('#code').val();
        if('' == $tel){
            confirm('注册号码不能为空');
        }
        else if('' == $code){
            confirm('验证码不能为空');
        }else{
            $.ajax({
                type: "get",
                url: "__APP__/apishop/apishop/codeLogin",
                cache: false,
                data: {tel: $tel,code: $code,type: 'WEB'},
                dataType: "json",
                success: function (data) {
                    console.log(data);
                    if (200 == data['status']) {
                        location.href = "__APP__/supplies/index/index";
                    }else{
                        confirm(data['msg'])
                    }
                }
            });
        }
    })
</script>
</html>